package ar.com.temporis.fixture.manufacturing;

import java.util.Calendar;
import java.util.Date;

import ar.com.temporis.fixture.SimpleFixture;
import ar.com.temporis.manufacturing.domain.ManufacturingOrder;

/**
 * 
 * @author matias.sulik
 *
 */
public class ManufacturingOrderFixture extends SimpleFixture {

	@Override
	protected void addEntities() {
		Calendar calendar = Calendar.getInstance();
		for (int i = 0; i < 15; i++) {
			calendar.add(Calendar.HOUR_OF_DAY, i);
			calendar.add(Calendar.MINUTE, i);
			this.add(this.createManufacturingOrder("title" + i, "description" + i, calendar.getTime(), calendar.getTime()));
		}
	}

	public ManufacturingOrder createManufacturingOrder(String title, String description, Date creationDate, Date dueDate) {
		ManufacturingOrder order = new ManufacturingOrder();
		order.setTitle(title);
		order.setDescription(description);
		order.setCreationDate(creationDate);
		order.setDueDate(dueDate);
		return order;
	}

}
